package com.china.bike.mapper;

import com.china.bike.dto.BikeListParam;
import com.china.bike.entity.BikeInfo;
import com.china.bike.entity.BikeUseRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author liuteng
 * @date 2018/4/6
 */
@Mapper
public interface BikeInfoMapper {

    int saveBikeInfo(@Param("bikeInfoList") List<BikeInfo> bikeInfoList);

    int updateBikeStatus(@Param("bikeInfo") BikeInfo bikeInfo);

    List<BikeInfo> listBikes(@Param("bikeListParam") BikeListParam bikeListParam);

    Integer listBikeCount(@Param("bikeListParam") BikeListParam bikeListParam);

    List<BikeUseRecord> getBikeUseRecord(@Param("bikeIds") List<Long> bikeIds);

    List<Map<String, String>> getBikeUseRecordCountByBikeId(@Param("bikeIds") List<Long> bikeIds);

    List<BikeInfo> listBikes(@Param("status") Integer status);

    void driveBike(BikeUseRecord bikeUseRecord);

    List<BikeUseRecord> getBikeByUserId(@Param("userId") Long UserId, @Param("start") Integer start, @Param("limit") Integer limit);

    void lockBike(BikeUseRecord bikeUseRecord);

    int getBikeByUserIdCount(Long userId);

    int deleteBike(String bikeNum);
}
